home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Tool Chest / Development Platforms / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / Windows.p < prev   
Encoding:
Text File  |  1993-09-16  |  7.6 KB  |  277 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Saturday, December 15, 1990 at 8:08 PM
  3.     Windows.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.         Copyright Apple Computer, Inc.    1985-1990
  7.         All rights reserved.
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Windows;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingWindows}
  21. {$SETC UsingWindows := 1}
  22.  
  23. {$I+}
  24. {$SETC WindowsIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingQuickdraw}
  27. {$I $$Shell(PInterfaces)Quickdraw.p}
  28. {$ENDC}
  29. {$IFC UNDEFINED UsingEvents}
  30. {$I $$Shell(PInterfaces)Events.p}
  31. {$ENDC}
  32. {$IFC UNDEFINED UsingControls}
  33. {$I $$Shell(PInterfaces)Controls.p}
  34. {$ENDC}
  35. {$SETC UsingIncludes := WindowsIncludes}
  36.  
  37. CONST
  38. documentProc = 0;
  39. dBoxProc = 1;
  40. plainDBox = 2;
  41. altDBoxProc = 3;
  42. noGrowDocProc = 4;
  43. movableDBoxProc = 5;
  44. zoomDocProc = 8;
  45. zoomNoGrow = 12;
  46. rDocProc = 16;
  47. dialogKind = 2;
  48. userKind = 8;
  49.  
  50. {FindWindow Result Codes}
  51. inDesk = 0;
  52. inMenuBar = 1;
  53. inSysWindow = 2;
  54. inContent = 3;
  55. inDrag = 4;
  56. inGrow = 5;
  57. inGoAway = 6;
  58. inZoomIn = 7;
  59. inZoomOut = 8;
  60.  
  61. {window messages}
  62. wDraw = 0;
  63. wHit = 1;
  64. wCalcRgns = 2;
  65. wNew = 3;
  66. wDispose = 4;
  67. wGrow = 5;
  68. wDrawGIcon = 6;
  69.  
  70. {defProc hit test codes}
  71. wNoHit = 0;
  72. wInContent = 1;
  73. wInDrag = 2;
  74. wInGrow = 3;
  75. wInGoAway = 4;
  76. wInZoomIn = 5;
  77. wInZoomOut = 6;
  78. deskPatID = 16;
  79.  
  80. {Window Part Identifiers which correlate color table entries with window elements}
  81. wContentColor = 0;
  82. wFrameColor = 1;
  83. wTextColor = 2;
  84. wHiliteColor = 3;
  85. wTitleBarColor = 4;
  86.  
  87. TYPE
  88. WindowPeek = ^WindowRecord;
  89. WindowRecord = RECORD
  90.     port: GrafPort;
  91.     windowKind: INTEGER;
  92.     visible: BOOLEAN;
  93.     hilited: BOOLEAN;
  94.     goAwayFlag: BOOLEAN;
  95.     spareFlag: BOOLEAN;
  96.     strucRgn: RgnHandle;
  97.     contRgn: RgnHandle;
  98.     updateRgn: RgnHandle;
  99.     windowDefProc: Handle;
  100.     dataHandle: Handle;
  101.     titleHandle: StringHandle;
  102.     titleWidth: INTEGER;
  103.     controlList: ControlHandle;
  104.     nextWindow: WindowPeek;
  105.     windowPic: PicHandle;
  106.     refCon: LONGINT;
  107.     END;
  108.  
  109. CWindowPeek = ^CWindowRecord;
  110. CWindowRecord = RECORD
  111.     port: CGrafPort;
  112.     windowKind: INTEGER;
  113.     visible: BOOLEAN;
  114.     hilited: BOOLEAN;
  115.     goAwayFlag: BOOLEAN;
  116.     spareFlag: BOOLEAN;
  117.     strucRgn: RgnHandle;
  118.     contRgn: RgnHandle;
  119.     updateRgn: RgnHandle;
  120.     windowDefProc: Handle;
  121.     dataHandle: Handle;
  122.     titleHandle: StringHandle;
  123.     titleWidth: INTEGER;
  124.     controlList: ControlHandle;
  125.     nextWindow: CWindowPeek;
  126.     windowPic: PicHandle;
  127.     refCon: LONGINT;
  128.     END;
  129.  
  130. WStateDataPtr = ^WStateData;
  131. WStateDataHandle = ^WStateDataPtr;
  132. WStateData = RECORD
  133.     userState: Rect;            {user state}
  134.     stdState: Rect;             {standard state}
  135.     END;
  136.  
  137. AuxWinPtr = ^AuxWinRec;
  138. AuxWinHandle = ^AuxWinPtr;
  139. AuxWinRec = RECORD
  140.     awNext: AuxWinHandle;       {handle to next AuxWinRec}
  141.     awOwner: WindowPtr;         {ptr to window }
  142.     awCTable: CTabHandle;       {color table for this window}
  143.     dialogCItem: Handle;        {handle to dialog manager structures}
  144.     awFlags: LONGINT;           {reserved for expansion}
  145.     awReserved: CTabHandle;     {reserved for expansion}
  146.     awRefCon: LONGINT;          {user Constant}
  147.     END;
  148.  
  149. WCTabPtr = ^WinCTab;
  150. WCTabHandle = ^WCTabPtr;
  151. WinCTab = RECORD
  152.     wCSeed: LONGINT;            {reserved}
  153.     wCReserved: INTEGER;        {reserved}
  154.     ctSize: INTEGER;            {usually 4 for windows}
  155.     ctTable: ARRAY [0..4] OF ColorSpec;
  156.     END;
  157.  
  158.  
  159. PROCEDURE InitWindows;
  160.     INLINE $A912;
  161. PROCEDURE GetWMgrPort(VAR wPort: GrafPtr);
  162.     INLINE $A910;
  163. FUNCTION NewWindow(wStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN;
  164.     theProc: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT): WindowPtr;
  165.     INLINE $A913;
  166. FUNCTION GetNewWindow(windowID: INTEGER;wStorage: Ptr;behind: WindowPtr): WindowPtr;
  167.     INLINE $A9BD;
  168. PROCEDURE CloseWindow(theWindow: WindowPtr);
  169.     INLINE $A92D;
  170. PROCEDURE DisposeWindow(theWindow: WindowPtr);
  171.     INLINE $A914;
  172. PROCEDURE GetWTitle(theWindow: WindowPtr;VAR title: Str255);
  173.     INLINE $A919;
  174. PROCEDURE SelectWindow(theWindow: WindowPtr);
  175.     INLINE $A91F;
  176. PROCEDURE HideWindow(theWindow: WindowPtr);
  177.     INLINE $A916;
  178. PROCEDURE ShowWindow(theWindow: WindowPtr);
  179.     INLINE $A915;
  180. PROCEDURE ShowHide(theWindow: WindowPtr;showFlag: BOOLEAN);
  181.     INLINE $A908;
  182. PROCEDURE HiliteWindow(theWindow: WindowPtr;fHilite: BOOLEAN);
  183.     INLINE $A91C;
  184. PROCEDURE BringToFront(theWindow: WindowPtr);
  185.     INLINE $A920;
  186. PROCEDURE SendBehind(theWindow: WindowPtr;behindWindow: WindowPtr);
  187.     INLINE $A921;
  188. FUNCTION FrontWindow: WindowPtr;
  189.     INLINE $A924;
  190. PROCEDURE DrawGrowIcon(theWindow: WindowPtr);
  191.     INLINE $A904;
  192. PROCEDURE MoveWindow(theWindow: WindowPtr;hGlobal: INTEGER;vGlobal: INTEGER;
  193.     front: BOOLEAN);
  194.     INLINE $A91B;
  195. PROCEDURE SizeWindow(theWindow: WindowPtr;w: INTEGER;h: INTEGER;fUpdate: BOOLEAN);
  196.     INLINE $A91D;
  197. PROCEDURE ZoomWindow(theWindow: WindowPtr;partCode: INTEGER;front: BOOLEAN);
  198.     INLINE $A83A;
  199. PROCEDURE InvalRect(badRect: Rect);
  200.     INLINE $A928;
  201. PROCEDURE InvalRgn(badRgn: RgnHandle);
  202.     INLINE $A927;
  203. PROCEDURE ValidRect(goodRect: Rect);
  204.     INLINE $A92A;
  205. PROCEDURE ValidRgn(goodRgn: RgnHandle);
  206.     INLINE $A929;
  207. PROCEDURE BeginUpdate(theWindow: WindowPtr);
  208.     INLINE $A922;
  209. PROCEDURE EndUpdate(theWindow: WindowPtr);
  210.     INLINE $A923;
  211. PROCEDURE SetWRefCon(theWindow: WindowPtr;data: LONGINT);
  212.     INLINE $A918;
  213. FUNCTION GetWRefCon(theWindow: WindowPtr): LONGINT;
  214.     INLINE $A917;
  215. PROCEDURE SetWindowPic(theWindow: WindowPtr;pic: PicHandle);
  216.     INLINE $A92E;
  217. FUNCTION GetWindowPic(theWindow: WindowPtr): PicHandle;
  218.     INLINE $A92F;
  219. FUNCTION CheckUpdate(VAR theEvent: EventRecord): BOOLEAN;
  220.     INLINE $A911;
  221. PROCEDURE ClipAbove(window: WindowPeek);
  222.     INLINE $A90B;
  223. PROCEDURE SaveOld(window: WindowPeek);
  224.     INLINE $A90E;
  225. PROCEDURE DrawNew(window: WindowPeek;update: BOOLEAN);
  226.     INLINE $A90F;
  227. PROCEDURE PaintOne(window: WindowPeek;clobberedRgn: RgnHandle);
  228.     INLINE $A90C;
  229. PROCEDURE PaintBehind(startWindow: WindowPeek;clobberedRgn: RgnHandle);
  230.     INLINE $A90D;
  231. PROCEDURE CalcVis(window: WindowPeek);
  232.     INLINE $A909;
  233. PROCEDURE CalcVisBehind(startWindow: WindowPeek;clobberedRgn: RgnHandle);
  234.     INLINE $A90A;
  235. FUNCTION GrowWindow(theWindow: WindowPtr;startPt: Point;bBox: Rect): LONGINT;
  236.     INLINE $A92B;
  237. FUNCTION FindWindow(thePoint: Point;VAR theWindow: WindowPtr): INTEGER;
  238.     INLINE $A92C;
  239. FUNCTION PinRect(theRect: Rect;thePt: Point): LONGINT;
  240.     INLINE $A94E;
  241. FUNCTION DragGrayRgn(theRgn: RgnHandle;startPt: Point;boundsRect: Rect;
  242.     slopRect: Rect;axis: INTEGER;actionProc: ProcPtr): LONGINT;
  243.     INLINE $A905;
  244. FUNCTION TrackBox(theWindow: WindowPtr;thePt: Point;partCode: INTEGER): BOOLEAN;
  245.     INLINE $A83B;
  246. PROCEDURE GetCWMgrPort(VAR wMgrCPort: CGrafPtr);
  247.     INLINE $AA48;
  248. PROCEDURE SetWinColor(theWindow: WindowPtr;newColorTable: WCTabHandle);
  249.     INLINE $AA41;
  250. FUNCTION GetAuxWin(theWindow: WindowPtr;VAR awHndl: AuxWinHandle): BOOLEAN;
  251.     INLINE $AA42;
  252. PROCEDURE SetDeskCPat(deskPixPat: PixPatHandle);
  253.     INLINE $AA47;
  254. FUNCTION NewCWindow(wStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN;
  255.     procID: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT): WindowPtr;
  256.     INLINE $AA45;
  257. FUNCTION GetNewCWindow(windowID: INTEGER;wStorage: Ptr;behind: WindowPtr): WindowPtr;
  258.     INLINE $AA46;
  259. FUNCTION GetWVariant(theWindow: WindowPtr): INTEGER;
  260.     INLINE $A80A;
  261. FUNCTION GetGrayRgn: RgnHandle;
  262.     INLINE $2EB8,$09EE;
  263. PROCEDURE SetWTitle(theWindow: WindowPtr;title: Str255);
  264.     INLINE $A91A;
  265. FUNCTION TrackGoAway(theWindow: WindowPtr;thePt: Point): BOOLEAN;
  266.     INLINE $A91E;
  267. PROCEDURE DragWindow(theWindow: WindowPtr;startPt: Point;boundsRect: Rect);
  268.     INLINE $A925;
  269.  
  270.  
  271. {$ENDC}    { UsingWindows }
  272.  
  273. {$IFC NOT UsingIncludes}
  274.     END.
  275. {$ENDC}
  276.  
  277.